package com.inventive.jmscache.server;

import javax.jms.Queue;
import javax.jms.JMSException;
import java.util.List;
import java.util.Iterator;

/**
 * @author Grant Little <grant.little@coreservices.com.au>
 */
public class JmsCacheQueue extends JmsCacheDestination implements Queue {

    public JmsCacheQueue(JmsCacheServer jmsCacheServer, String name) {
        super(jmsCacheServer, name, DestinationType.QUEUE);
    }

    public String getQueueName() throws JMSException {
        return name;
    }

    public List<JmsCacheMessage> getMessages(String messageSelector) {
        return jmsCacheServer.getMessages(this.name, messageSelector);
    }

    public Iterator<JmsCacheMessage> getMessageIterator(String messageSelector) {
        return jmsCacheServer.getMessageIterator(this.name, messageSelector);
    }
}
